@extends('admin.layout.index')
@section('title', '后台分类添加')
@section('header', '分类添加')
@section('con')
	<div class="col-lg-12">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">
            	@if (count($errors) > 0)
            	    <div class="alert alert-danger">
            	        <ul>
            	            @foreach ($errors->all() as $error)
            	                <li>{{ $error }}</li>
            	            @endforeach
            	        </ul>
            	    </div>
            	@endif
                <div class="col-lg-6 col-lg-offset-3">
                    <form role="form" method="post" action="{{url('/admin/cate/insert')}}">
                        <div class="form-group">
                            <label>选择分类</label>
                            <select class="form-control" name="pid">
                                <option value="0">顶级分类</option>
                            @foreach($cates as $k=>$v)
                                <option value="{{$v->id}}">{{$v->title}}</option>
                            @endforeach
                            </select>
                        </div>

                        <div class="form-group">
                            <label>分类名</label>
                            <input class="form-control" type="text" name="title" value="{{old('username')}}">
                        </div>
                       

                        {{ csrf_field() }}
                       
                        <button class="btn btn-default" type="submit">添加</button>
                        <button class="btn btn-default" type="reset">重置</button>
                    </form>
                </div>
             
            </div>
            <!-- /.row (nested) -->
        </div>
        <!-- /.panel-body -->
    </div>
    <!-- /.panel -->
</div>
@endsection